#!/usr/bin/env python3

import os
import signal
import curses

import config
from lib.sermon import Sermon


if __name__ == '__main__':
    os.setpgrp()
    try:
        curses.wrapper(lambda scr: Sermon(scr, config.SERVICES).run())
    except Exception as err:
        print(err)
    finally:
        os.killpg(0, signal.SIGKILL)
